<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/28
 * Time: 9:18
 */

namespace app\admin\model;


use think\Model;

class Order extends Model
{

    protected $table="duck_shop_order";
    public function user(){
        return $this->belongsTo('MemberUser','user_id','id');
    }
    public function shop(){
        return $this->belongsTo('ShopList','shop_id','id');
    }
    public function table(){
        return $this->belongsTo('ShopTable','table_id','id');
    }
    public function orderFoods(){
        return $this->hasMany('orderFoods','order_no','order_no');
    }
    public function getPayTimeAttr($value){
        return date("Y-m-d H:i:s",$value);
    }
    public function getOrderTimeAttr($value){
        return date("Y-m-d H:i:s",$value);
    }
}